<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>Labofjet 简简单单才是美</title>
<meta name="description" content="Jet的博客">
<meta name="keywords" content="labofjet">
<meta name="HandheldFriendly" content="True">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%@include file="/jsp/import/head.jsp"%>
<link href="resources/css/index2.css" rel="stylesheet" />
<script type="text/javascript" src="resources/js/index2.js"></script>
<link href="resources/um/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="resources/um/umeditor.config.js"></script>
<script type="text/javascript" src="resources/um/umeditor.min.js"></script>
<script type="text/javascript" src="resources/um/lang/zh-cn/zh-cn.js"></script>
</head>
<body class="home-template">
	<!-- start header -->
	<c:import var="data" url="/jsp/import/header.jsp" />
	${data }
	<!-- end header -->

	<!-- start navigation -->
	<c:import var="data" url="/jsp/import/navigation.jsp" />
	${data }
	<!-- end navigation -->

	<!-- start site's main content area -->
	<section class="content-wrap">
		<div class="container">
			<div class="row">
				<main class="col-md-8 main-content"> <!-- start 历史 -->
				<div class="panel panel-danger">
					<div class="panel-heading">修改文章</div>
					<div class="panel panel-body">
						<form action="manage/artical/update/${artical.id}" method="post">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon">标题 :</div>
									<input class="form-control" type="text" name="title" value="${artical.title}">
								</div>
							</div>
							<hr>
							<div>
								<p>标签</p>
								<p>
									<select multiple="multiple" class="form-control" name="category" size="8">
										<c:forEach var="category" items="${categories}" varStatus="status">
											<option value="${category.id}" 
												<c:forEach var="c" items="${artical.categories}">
													<c:if test="${c.content == category.content}">selected="selected"</c:if>
												</c:forEach>>${category.content}</option>
										</c:forEach>
									</select>
								</p>
							</div>
							<div>
								<p>简介</p>
								<textarea class="form-control" name="introduction" rows="3" placeholder="简介">${artical.introduction }</textarea>
							</div>
							<br>
							<div>
								<p>等级</p>
								<input class="form-control" name="level" type="text" value="${artical.level }" />
							</div>
							<br>
							<div>
								<script id="myEditor" name="htmlContent" type="text/plain" class="form-control">${artical.htmlContent }</script>
							</div>
							<br>
							<div>
								<textarea class="form-control hide" name="rawContent" rows="3" id="rawContent">${artical.rawContent }</textarea>
							</div>
							<br> <input class="form-control hide" type="text" name="id" value="${artical.id}">
							<hr>
							<button type="submit" class="btn btn-success">提交</button>
						</form>
					</div>
				</div>
				<!-- end 历史 --> </main>
				<aside class="col-md-4 sidebar">
					<!-- start widget -->
					<!-- end widget -->

					<!-- start widget -->
					<c:import var="data" url="/jsp/import/search.jsp" />
					${data }
					<!-- end widget -->


					<!-- start tag cloud widget -->
					<c:import var="data" url="/category-list" />
					${data }
					<!-- end tag cloud widget -->


					<!-- start widget -->
					<c:import var="data" url="/jsp/import/login.jsp" />
					${data }
					<!-- end widget -->

					<!-- start widget -->
					<!-- end widget -->
				</aside>
			</div>
		</div>
	</section>

	<!-- start footer -->
	<c:import var="data" url="/jsp/import/footer.jsp" />
	${data }
	<!-- end footer -->
	<script type="text/javascript">
		//实例化编辑器
		var um = UM.getEditor('myEditor',{
			initialFrameHeight : '400'
		});
		//提交
		$('form').submit(function(e) {
			$('#rawContent').val(UM.getEditor('myEditor').getContentTxt());
		});
	</script>
</body>
</html>